﻿CREATE FUNCTION QIC.ObjectName(@ObjectId INT)
RETURNS VARCHAR(MAX)
AS
BEGIN

	DECLARE @Retval VARCHAR(MAX)

	SELECT @Retval = QUOTENAME(SCHEMA_NAME(schema_id)) + '.' + QUOTENAME(OBJECT_NAME(object_id))
	FROM sys.objects WHERE object_id = @ObjectId

	RETURN @Retval

END